import Vue from 'vue'
import VueRouter from "vue-router";
import train from "../components/admin/train";
import user from "../components/admin/user";
import sale from "../components/admin/sale"
import refund from "../components/admin/refund"
import ticket from "../components/admin/ticket"
import login from "../components/login"
import shop from "../components/user/shop"
import manager from "../components/admin/manager"
import order from "../components/user/order"
import users from "../components/user/users"
import ticShop from "../components/user/ticShop"
import refOrder from "@/components/user/refOrder";

Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        {path: '/', redirect: 'login'},
        {path: '/login', component: login},
        {
            path: '/manager', component: manager, children: [
                {path: 'train', component: train},
                {path: 'user', component: user},
                {path: 'sale', component: sale},
                {path: 'refund', component: refund},
                {path: 'ticket', component: ticket},
            ]
        },
        {
            path: '/users', component: users, children: [
                {path: 'shop', component: shop},
                {path: 'ticShop', component: ticShop},
                {path: 'order', component: order},
                {path: 'refOrder', component: refOrder}
            ]
        },
    ]
})

export default router